package com.hxexp.weixin.test.api;

import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;

import com.hxexp.weixin.common.exception.APIException;
import com.hxexp.weixin.hpe.api.userorderlist.UserOrderListAPI;
import com.hxexp.weixin.hpe.api.userorderlist.model.UserOrderListParamBean;
import com.hxexp.weixin.hpe.api.userorderlist.model.UserOrderListResultBean;
import com.hxexp.weixin.test.runner.JUnit4WithSpringLogClassRunner;

/**
 * 用户订单列表接口实现类测试
 *
 * @author wang.bin
 *
 */
@RunWith(JUnit4WithSpringLogClassRunner.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@ContextConfiguration(locations = { "classpath:conf/spring/spring-biz.xml", "classpath:conf/spring/spring-ehcache.xml" })
public class UserOrderListAPIImplTester {

    @Autowired
    private UserOrderListAPI userOrderListAPI;

    @Test
    public void testCase01() throws APIException {

        UserOrderListParamBean userOrderListParamBean = new UserOrderListParamBean();
        UserOrderListResultBean returnValue = new UserOrderListResultBean();
        int pageSize = 6;
        int pageNow = 1;
        // 设置请求参数
        userOrderListParamBean.setUserId("16229bd2ca19455facd7df4dd030d0a1");
        userOrderListParamBean.setPageSize(pageSize);
        userOrderListParamBean.setPageNow(pageNow);

        returnValue = userOrderListAPI.getOrderList(userOrderListParamBean);
        System.out.println(returnValue);
    }
}
